﻿#ifndef RECORD_H
#define RECORD_H
#include "trainingreport.h"
#include "evaluationreport.h"
#include <QWidget>
#include "userDataFormate.h"
#include "currentuserdata.h"
#include "deletereport.h"
#include "reportcompared.h"
namespace Ui {
class Record;
}

class Record : public QWidget
{
    Q_OBJECT

public:
    explicit Record(QWidget *parent = nullptr);
    ~Record();


private slots:

    void on_evaluateBackPage_btn_clicked();

    void on_evaluateGo_btn_clicked();

    void on_trainFrontPage_btn_clicked();

    void on_trainBackPage_btn_clicked();

    void on_trainGo_btn_clicked();

    void on_evaluateRecord_Btn_clicked();

    void on_trainRecord_Btn_clicked();

	void slotEvaluateCellWidgetClicked(int row,int column);

    void slotTrainingCellWidgetClicked(int row,int column);
	void on_trainSelectAll_checkBox_toggled(bool checked);

	void on_trainDelete_btn_clicked();
    void on_evaluateDelete_btn_clicked();

    void on_evaluateSelectAll_checkBox_toggled(bool checked);

    void on_trainVs_pushButton_clicked();

    void on_evaluationVs_pushButton_clicked();

    void on_evaluateFrontPage_btn_clicked();

protected:
    virtual void showEvent(QShowEvent *event);

    virtual void changeEvent(QEvent* event);
private:
    //填充评估表
    void fillEvaluateTable(int pageIndex);
    //填充训练表
    void fillTrainTable(int pageIndex);
    //初始化控件
    void initWidget();
    //初始化训练表格
    void initTrainRecordTable();
    //初始化评估表
    void initEvaluateRecordTable();
//更新训练部分底部显示
    void updateTrainBottomSetting(int num);
    //更新评估部分底部显示
    void updateEvaluateBottomSetting(int num);
private:
    Ui::Record *ui;
    const int m_perPageCount;       //每页显示的个数
    int m_trainTableCurrentPage;    //tablewidget当前的页码，从1开始
    int m_evaluateTableCurrentPage; //evaluateTablewidget当前的页码，从1开始

    int m_trainRecordTotalPage;     //训练记录总页数
    int m_evaluateRecordTotalPage;  //评估记录总页数
    ST_EvaluateReport st_evaluateReport; //评估报告
    QList<QVariantMap> trainVariantMap;
    QList<QVariantMap> evaluateVariantMap;
 	int evaluateDisplayCount;   //评估表当前页显示的行数
    int trainingDisplayCount;   //训练表当前页显示的行数

    TrainingReport *trainReport;
    evaluationReport *evaluateReport;
    DeleteReport *m_deleteRepoet;
    ReportCompared *m_reportCompared;

};

#endif // RECORD_H
